import moduleRegist from '@/utils/moduleRegist';

import { module as SettlementCollectModule } from './Module/settlementCollect';
import { module as SettlementDetailModule } from './Module/settlementDetail';
import { module as SettlementAbnormalModule } from './Module/settlementAbnormalModule';
import { module as ClearingCollectModule } from './Module/clearingCollectModule';
import { module as ClearingDeteleAccountModule } from './Module/clearingDeteleAccountModule';
import { module as ClearingDeteleCountModule } from './Module/clearingDeteleCountModule';
import { module as ClearingAbnormalModule } from './Module/clearingAbnormalModule';
import { module as AccountCheckingModule } from './Module/accountCheckingModule';

const Layout = resolve => { require(['./Layout'], resolve); };
const AccountChecking = resolve => { require(['./AccountChecking'], resolve); };
const AccountCheckingList = resolve => { require(['./AccountCheckingList/accountCheckingList'], resolve); };
const SettlementCollect = resolve => { require(['./SettlementCollect'], resolve); };
const SettlementDetail = resolve => { require(['./SettlementDetail'], resolve); };
const SettlementDetailForm = resolve => { require(['./SettlementDetailForm'], resolve); };
const SettlementAbnormal = resolve => { require(['./SettlementAbnormal'], resolve); };
const SettlementAbnormalBatchProcessing = resolve => { require(['./SettlementAbnormalBatchProcessing'], resolve); };
const SettlementAbnormalAloneProcessing = resolve => { require(['./SettlementAbnormalAloneProcessing'], resolve); };
const ClearingCollect = resolve => { require(['./ClearingCollect'], resolve); };
const ClearingDetele = resolve => { require(['./ClearingDetele'], resolve); };
const ClearingAbnormal = resolve => { require(['./ClearingAbnormal'], resolve); };

const ClearingDeteleForm = resolve => { require(['./ClearingDeteleForm'], resolve); };
const ClearingAbnormalForm = resolve => { require(['./ClearingAbnormalForm'], resolve); };
const ClearingAbnormaRemarklForm = resolve => { require(['./ClearingAbnormaRemarklForm'], resolve); };

const ClearingAbnormalMatch = resolve => { require(['./ClearingAbnormalMatch'], resolve); };
const ClearingAbnormalRemark = resolve => { require(['./ClearingAbnormalRemark'], resolve); };

export default [
    /** 配置管理路由 */
    {
        path: 'settlementCenter',
        redirect: 'settlementCenter/settlementCollect',
        component: Layout,
        meta: {
            title: '对账中心',
            name: '对账中心',
            permission: 'trade:settlement:settleManage',
            componentName: 'OrderpayerLayout',
            keepAlive: true,
            icon: 'md-people',
            show: false
        },
        beforeEnter: (to, from, next) => {
            /* eslint-disable */
            moduleRegist(SettlementCollectModule);
            moduleRegist(SettlementDetailModule);
            moduleRegist(SettlementAbnormalModule);
            moduleRegist(ClearingCollectModule);
            moduleRegist(ClearingDeteleAccountModule);
            moduleRegist(ClearingDeteleCountModule);
            moduleRegist(ClearingAbnormalModule);
            moduleRegist(AccountCheckingModule);
            next()
        },
        children: [{
                path: 'accountChecking',
                component: AccountChecking,
                meta: {
                    title: '交易资金对账详情',
                    name: '交易资金对账详情',
                    breadcrumb: '交易资金对账详情',
                    permission: 'trade:settlement:settleManage:funds',
                    show: false,
                    keepAlive: true,
                    componentName: 'accountChecking',
                    icon: ''
                }
            },
            {
                path: 'accountCheckingList',
                component: AccountCheckingList,
                meta: {
                    title: '交易资金对账',
                    name: '交易资金对账',
                    breadcrumb: '交易资金对账',
                    permission: 'trade:settlement:settleManage:funds',
                    show: true,
                    keepAlive: true,
                    componentName: 'accountCheckingList',
                    icon: ''
                }
            },
            {
                path: 'settlementCollect',
                component: SettlementCollect,
                meta: {
                    title: '流水汇总对账',
                    name: '流水汇总对账',
                    breadcrumb: '流水汇总对账',
                    permission: 'trade:settlement:cmb',
                    show: true,
                    keepAlive: true,
                    componentName: 'settlementCollect',
                    icon: ''
                }
            },
            {
                path: 'settlementDetail',
                component: SettlementDetail,
                meta: {
                    title: '流水明细对账',
                    name: '流水明细对账',
                    breadcrumb: '流水明细对账',
                    permission: 'trade:settlement:cmb',
                    show: true,
                    keepAlive: true,
                    componentName: 'settlementDetail',
                    icon: ''
                }
            },
            {
                path: 'settlementAbnormal',
                component: SettlementAbnormal,
                meta: {
                    title: '流水异常对账',
                    name: '流水异常对账',
                    breadcrumb: '流水异常对账',
                    permission: 'trade:settlement:cmb',
                    show: true,
                    keepAlive: true,
                    componentName: 'settlementAbnormal',
                    icon: ''
                }
            },
            {
                path: 'settlementDetailForm',
                component: SettlementDetailForm,
                meta: {
                    title: '交易流水详情',
                    name: '交易流水详情',
                    breadcrumb: '交易流水详情',
                    permission: 'trade:settlement:cmb',
                    keepAlive: false,
                    show: false,
                    componentName: 'settlementDetailForm',
                    icon: ''
                }
            },
            {
                path: 'settlementAbnormalBatchProcessing',
                component: SettlementAbnormalBatchProcessing,
                meta: {
                    title: '流水差异批量处理',
                    name: '流水差异批量处理',
                    breadcrumb: '流水差异批量处理',
                    permission: 'trade:settlement:cmb',
                    keepAlive: false,
                    show: false,
                    componentName: 'settlementAbnormalBatchProcessing',
                    icon: ''
                }
            },
            {
                path: 'settlementAbnormalAloneProcessing',
                component: SettlementAbnormalAloneProcessing,
                meta: {
                    title: '流水差异处理',
                    name: '流水差异处理',
                    breadcrumb: '流水差异处理',
                    permission: 'trade:settlement:cmb',
                    keepAlive: true,
                    show: false,
                    componentName: 'settlementAbnormalAloneProcessing',
                    icon: ''
                }
            },
            {
                path: 'clearingCollect',
                component: ClearingCollect,
                meta: {
                    title: '清分汇总统计',
                    name: '清分汇总统计',
                    breadcrumb: '清分汇总统计',
                    permission: 'trade:settlement:cmb',
                    keepAlive: true,
                    show: true,
                    componentName: 'clearingCollect',
                    icon: ''
                }
            },
            {
                path: 'clearingDetele',
                component: ClearingDetele,
                meta: {
                    title: '清分对账',
                    name: '清分对账',
                    breadcrumb: '清分对账',
                    permission: 'trade:settlement:cmb',
                    keepAlive: true,
                    show: true,
                    componentName: 'clearingDetele',
                    icon: ''
                }
            },
            {
                path: 'clearingAbnormal',
                component: ClearingAbnormal,
                meta: {
                    title: '清分异常处理',
                    name: '清分异常处理',
                    breadcrumb: '清分异常处理',
                    permission: 'trade:settlement:cmb',
                    keepAlive: true,
                    show: true,
                    componentName: 'clearingAbnormal',
                    icon: ''
                }
            },
            {
                path: 'ClearingDeteleForm',
                component: ClearingDeteleForm,
                meta: {
                    title: '清分对账明细详情',
                    name: '清分对账明细详情',
                    breadcrumb: '清分对账明细详情',
                    permission: 'trade:settlement:cmb',
                    keepAlive: false,
                    show: false,
                    componentName: 'clearingDeteleForm',
                    icon: ''
                }
            },
            {
                path: 'ClearingAbnormalForm',
                component: ClearingAbnormalForm,
                meta: {
                    title: '清分对账详情',
                    name: '清分对账详情',
                    breadcrumb: '清分对账详情',
                    permission: 'trade:settlement:cmb',
                    keepAlive: false,
                    show: false,
                    componentName: 'clearingAbnormalForm',
                    icon: ''
                }
            },
            {
                path: 'ClearingAbnormaRemarklForm',
                component: ClearingAbnormaRemarklForm,
                meta: {
                    title: '清分对账详情',
                    name: '清分对账详情',
                    breadcrumb: '清分对账详情',
                    permission: 'trade:settlement:cmb',
                    keepAlive: false,
                    show: false,
                    componentName: 'clearingAbnormaRemarklForm',
                    icon: ''
                }
            },
            {
                path: 'ClearingAbnormalMatch',
                component: ClearingAbnormalMatch,
                meta: {
                    title: '清分异常处理',
                    name: '批量处理',
                    breadcrumb: '批量处理',
                    permission: 'trade:settlement:cmb',
                    keepAlive: false,
                    show: false,
                    componentName: 'clearingAbnormalMatch',
                    icon: ''
                }
            },
            {
                path: 'ClearingAbnormalRemark',
                component: ClearingAbnormalRemark,
                meta: {
                    title: '清分异常处理',
                    name: '批量备注',
                    breadcrumb: '批量备注',
                    permission: 'trade:settlement:cmb',
                    keepAlive: false,
                    show: false,
                    componentName: 'clearingAbnormalRemark',
                    icon: ''
                }
            }
        ]
    }
]